package com.bugpool.leilema.freamwork.datascope.impl;

import com.bugpool.leilema.freamwork.datascope.DataScopeStrategy;
import com.bugpool.leilema.tc.bean.dto.DataScopeDTO;

/**
 * @Author wh
 * @Description 部门数据权限
 * @Date 2023/6/13 17:24
 * @Version 1.0
 **/
public class DeptDataScope extends AbstractDataScope  {
    @Override
    public StringBuilder sqlEnhance(DataScopeDTO dataScopeDTO) {
        dataScopeDTO.getSqlStringBuilder()
                .append(" OR ")
                .append(dataScopeDTO.getTbAlias()+SUFFIX)
                .append("dept_id = ")
                .append(dataScopeDTO.getDeptId()).append(" ");
        return dataScopeDTO.getSqlStringBuilder();
    }
}
